<template>
  <div>
    <br>
    <van-nav-bar
        title="限时秒杀"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
    />

    <van-tabs v-model="active">
      <van-tab title="标准洗车">

        <van-cell-group v-for="item in standardList" :key="item.id">
          <van-card
              desc=""
              :price="item.jiage"
              :origin-price="item.menshi"
              :title="item.name"
              thumb="https://hh666.oss-cn-beijing.aliyuncs.com/ffb5bb8fa0fffa31a5a9fb05a0beaffb.jpeg"
              @click=""
          >
            <template #tags>
              <van-tag plain type="default">{{ item.xingji }}</van-tag>
              <van-tag plain type="default">{{ item.danshu }}单</van-tag>
              <van-tag plain type="default" style="right: -130px;">{{ item.juli }}</van-tag>
            </template>

            <template #footer>
              <van-button type="danger" size="base" @click="goumai(item.id)">购买</van-button>
            </template>
          </van-card>
          <van-button type="default" block @click="fuwu(item.id)">{{ item.xiche }}
          </van-button>
        </van-cell-group>
      </van-tab>
      <van-tab title="精致洗车">精致洗车</van-tab>
      <van-tab title="洗车打蜡">洗车打蜡</van-tab>
      <van-tab title="内饰清洗">内饰清洗</van-tab>
    </van-tabs>
  </div>
</template>

<script>
export default {
  data() {
    return {
      standardList: [],
      active: 0,
    }
  },
  methods: {
    goumai(id) {
      this.$router.push({path: '/dingdan', query: {id: id}})
    },
    // fuwu(id) {
    //   this.$router.push({ path: '/fuwu', query: { id: id } })
    // },
    findStandard() {
      this.axios.get(`http://1.94.221.254:9999/api/qcfw-home/home/standard/findStandard`).then(res => {
        this.standardList = res.data.data
      })
    },
    onClickLeft() {
      this.$router.go(-1)
    },
  },
  created() {
    this.findStandard()
    var token = localStorage.getItem('token');
    if (token === null) {
      this.$router.push('/');
    }
  }
}
</script>

<style scoped>

</style>
